import {createRouter, createWebHashHistory} from "vue-router"
import LoginPage from '../components/LoginPage.vue'
import RegisterPage from '../components/RegisterPage.vue'
import UserPage from '../components/UserPage.vue'
import UserSearch from '../components/UserSearch.vue'
import UserInfo from '../components/UserInfo.vue'
import UserChange from '../components/UserChange.vue'
import SqlPage from '../components/SqlPage.vue'
import OriginPage from '../components/OriginPage.vue'
import DataPage from '../components/DataPage.vue'

export default createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: "/",
            redirect:LoginPage
        },
        {
            path:"/login",
            name: "LoginPage",
            component: LoginPage,
        },
        {
            path:"/register",
            name:"Register",
            component: RegisterPage
        },
        {
            path:"/user",
            name:"UserPage",
            component: UserPage,
            children:[
                {
                    path:"search",
                    name:"UserSearch",
                    component: UserSearch
                },
                {
                    path:"info",
                    name:"UserInfo",
                    component: UserInfo
                },
                {
                    path:"change",
                    name:"UserChange",
                    component: UserChange
                },
                {
                    path:"sql",
                    name:"SqlPage",
                    component: SqlPage
                },
                {
                    path:"origin",
                    name:"OriginPage",
                    component: OriginPage
                },
                {
                    path:"data",
                    name:"DataPage",
                    component: DataPage
                },
            ]
        },
    ]
})
